package com.ruoyi.software.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.software.domain.SwCar;
import com.ruoyi.software.service.ISwCarService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/software/software")
@Api("车型信息")
public class SwCarController extends BaseController {
    @Autowired
    private ISwCarService iSwCarService;

    @GetMapping("/list")
    public TableDataInfo list(SwCar swCar){
        startPage();
        List<SwCar> list=iSwCarService.selectSwCarList(swCar);
        return getDataTable(list);
    }


    @GetMapping(value = "/{pid}")
    public AjaxResult getInfo(@PathVariable Long pid){
        return success(iSwCarService.selectSwCarByPid(pid));
    }

    @DeleteMapping("/{ids}")
    public AjaxResult delete(@PathVariable Long[] ids){
        return toAjax(iSwCarService.deleteSwCarByIds(ids));
    }

}
